﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.Planlama
{
    public partial class KesimAdetleri : XForm
    {
        public KesimAdetleri()
        {
            InitializeComponent();
        }

        private void KesimAdetleri_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetKesimAdetleri");
            gridView1.AddDetailGrid(gridView2, "CustomerId");
            gridView2.AddDetailGrid(gridView3, "DosyaNo");

            gridView2.MakeColumnInvisible("CustomerId");
            gridView3.MakeColumnInvisible("DosyaNo", "ProductId");

            gridView2.AddColumn("ToplamSip", typeof(int), "SUM(Child({FK}).ToplamSip)");
            gridView2.AddColumn("ToplamKes", typeof(int), "SUM(Child({FK}).ToplamKes)");
            gridView2.AddColumn("AsimAdedi", typeof(int), "SUM(Child({FK}).AsimAdedi)");
            gridView1.AddColumn("AsimAdedi", typeof(int), "SUM(Child({FK}).AsimAdedi)");


            gridView2.FormatAsDate("MxGun");
            gridView3.FormatAsDate("Gun");
            gridView1.FormatAsNumber(0, "AsimAdedi");
            gridView2.FormatAsNumber(0, "ToplamKes", "ToplamSip", "AsimAdedi");
            gridView3.FormatAsNumber(0, "ToplamKes", "ToplamSip", "AsimAdedi");
            gridView1.AddSummary("AsimAdedi");
            gridView2.AddSummary("ToplamKes", "ToplamSip", "AsimAdedi");
            gridView3.AddSummary("ToplamKes", "ToplamSip", "AsimAdedi");

            splitContainerControl2.AutoSize();

            gridView1.MakeRowSelectable();
            gridView2.MakeRowSelectable();
            gridView3.MakeRowSelectable();

            gridView1.MakeReadOnly();
            gridView2.MakeReadOnly();
            gridView3.MakeReadOnly();

            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
            gridView3.BestFitColumns();
        }
    }
}
